
/*************************************************************************
* Copyright (c) 2008, ShenZhen Coship Electronic Ltd Co.
* All rights reserved.
* 
* File Name:		MPEG4Decode.cpp
* Summary:			implementation of the CMPEG4Decode class.
* 
* Current Version:	1.0
* Author(s):
/------------------------------------------------------------------------/
revision			author				reason					date
1.0					Ding Ning			Initialize Version		2008-6-18
/------------------------------------------------------------------------/
*************************************************************************/

// MPEG4Decode.cpp: implementation of the CMPEG4Decode class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MPEG4Decode.h"
#include "ICodec.h"
//#include "../coship/DecBuf.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMPEG4Decode::CMPEG4Decode()
{
	m_bReversal = TRUE;
	m_cType = CODEC_MPEG4;
	m_pCodec = new CMPEG4Codec(320, 240, Decoder);
	m_pCodec->Open();
	m_szBuff = new char[1024*1024*2];
}

CMPEG4Decode::~CMPEG4Decode()
{
	SAFE_DELETE(m_szBuff);
	SAFE_DELETE(m_pCodec);
}

BOOL CMPEG4Decode::Init(const char* pbuf, int len)
{
	return TRUE;
}
void CMPEG4Decode::Destroy()
{
	return;
}
int CMPEG4Decode::GetWidth()
{
	return 320;
}

int CMPEG4Decode::GetHeight()
{
	return 240;
}

int CMPEG4Decode::GetBPP()
{
	return 24;
}

BOOL CMPEG4Decode::Decode(const char* pbuf, int len, int subLen)
{
	return m_pCodec->Write(pbuf, len, FALSE, m_szBuff);
	//	LPBITMAPFILEHEADER pHeader = (LPBITMAPFILEHEADER) m_szBuff;
	//	LPBITMAPINFOHEADER pInfo = (LPBITMAPINFOHEADER) (&m_szBuff[14]);
	//	return TRUE;
}

void CMPEG4Decode::InitPicInfo()
{
}

char* CMPEG4Decode::GetPicBuff()
{
	return m_szBuff;
}
